package com.alibaba.otter.canal.connector.core.consumer;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * OGG 生产的消息格式
 *
 * @author: yansheng
 * @date: 2020/11/5 13:56
 */
public class OggMessage implements Serializable {

    private static final long serialVersionUID = -65L;

    private String table;// 库名.表名
    private String op_type;// 操作类型 I: insert, U: update, D: delete, T: truncate
    private String op_ts;// 操作时间
    private String current_ts;// 当前时间
    private String pos;
    private List<Map<String, Object>> before;
    private List<Map<String, Object>> after;

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getOp_type() {
        return op_type;
    }

    public void setOp_type(String op_type) {
        this.op_type = op_type;
    }

    public String getOp_ts() {
        return op_ts;
    }

    public void setOp_ts(String op_ts) {
        this.op_ts = op_ts;
    }

    public String getCurrent_ts() {
        return current_ts;
    }

    public void setCurrent_ts(String current_ts) {
        this.current_ts = current_ts;
    }

    public String getPos() {
        return pos;
    }

    public void setPos(String pos) {
        this.pos = pos;
    }

    public List<Map<String, Object>> getBefore() {
        return before;
    }

    public void setBefore(List<Map<String, Object>> before) {
        this.before = before;
    }

    public List<Map<String, Object>> getAfter() {
        return after;
    }

    public void setAfter(List<Map<String, Object>> after) {
        this.after = after;
    }

    @Override
    public String toString() {
        return "OggMessage{" +
                "table='" + table + '\'' +
                ", op_type='" + op_type + '\'' +
                ", op_ts='" + op_ts + '\'' +
                ", current_ts='" + current_ts + '\'' +
                ", pos='" + pos + '\'' +
                ", before=" + before +
                ", after=" + after +
                '}';
    }
}
